<meta charset="utf-8">
<div class="box box-primary" id="pmpRequires_req_edit">
	<form role="form" id="pmpRequires_req_edit_form" >
		<div class="box-body">
			<div class="form-group">
				<label for="name" class="control-label"> 需求名称</label>
					<input type="text" name="name" v-model="pmpRequire.name" class="form-control" id="name" required />
			</div>
			<div class="form-group">
				<label for="orderNum" class="control-label"> 排列顺序</label>
				<input type="number" min="1" name="orderNum" v-model="pmpRequire.orderNum" class="form-control" id="orderNum" required />
			</div>
			<div class="form-group">
				<label for="password" class="control-label"> 优先级</label>
					<input type="number" min="1" name="priority" v-model="pmpRequire.priority" class="form-control" id="priority" required />
			</div>
			<div class="form-group">
				<label for="chargeUserId"> 负责人</label> 
				<select type="text"
					name="chargeUserId" v-model="pmpRequire.chargeUserId"
					v-kselect="{url:'/pmp/service/ma/pmpCloudMember/loadCloudMemberComboboVo',vmodel:'pmpRequire.chargeUserId',firstEmpty:'true'}"
					class="form-control" id="chargeUserId">
				</select>
			</div>
			
			<div class="form-group">
				<label for="detail" class="control-label"> 需求详情</label>
				<input type="text" name="detail" v-model="pmpRequire.detail" class="form-control" id="detail" required />
			</div>
			

			<div class="box-footer">
				<button type="button" class="btn btn-default" v-on:click="cancel">取消</button>
				<button type="button" class="btn btn-info pull-right" v-on:click="add">提交</button>
			</div>
	</div>
	</form>
	<script type="text/javascript">
		new Vue({
					el : '#pmpRequires_req_edit',
					data : {
						pmpRequire : {
							id : null,
							chargeUserId : null,
							priority : null,
							orderNum : null,
							detail : null,
							name : null
						},
						bus : new Vue(),
					},
					mounted : function() {
						var _this = this;
						var id = zfesLayerEditDg.getLayerParam().id;
			    		var  url="/pmp/service/pub/pmpRequires/loadPmpRequiresById";
						  zfesAjax.ajaxTodo(url,{"id":id},function(data) {
								_this.$data.pmpRequire=data.data.requires;
								console.log(_this.$data.pmpRequire);
						 })
						
					},
					methods : {
						add : function() {
							if ($("#pmpRequires_req_edit_form").valid()) {
								let _this = this;
								let url = "/pmp/service/pm/pmpRequires/updatePmpRequires";
								zfesAjax.ajaxTodo(url,_this.$data.pmpRequire,function(data) {
									alertSwal.successText(data.message);
										layer.close(layer.index);
								})
							}
						},
						cancel : function() {
							layer.close(layer.index);
						}
					}
				});
	</script>
</div>
